<?php if ($model->isSubmissionOpen()): ?>

	<?php if (!Yii::app()->user->isGuest): ?>
		<?php if (!$model->hasSubmittedEntry(Yii::app()->user->id)): ?>
			<?php echo CHtml::link(Yii::t('frontend','SUBMIT ENTRY'),array('contest/submitEntry','id'=>$model->id),
					array('class'=>'btn primary twipsify '.$buttonCssClass)); ?>
		<?php else: ?>
			<?php echo CHtml::link(Yii::t('frontend','SUBMIT ENTRY'),'',
					array('class'=>'btn primary twipsify disabled '.$buttonCssClass,'title'=>Yii::t('frontend','You have already submitted an entry for this contest'))); ?>
		<?php endif; ?>
	<?php else: ?>
		<?php echo CHtml::link(Yii::t('frontend','SUBMIT ENTRY'),'',
				array('class'=>'btn primary twipsify disabled '.$buttonCssClass,'title'=>Yii::t('frontend','Connect to Facebook in order to submit your entry'))); ?>
	<?php endif; ?>

<?php else: ?>

	<?php echo CHtml::link(Yii::t('frontend','SUBMIT ENTRY'),'',
			array('class'=>'btn primary twipsify disabled '.$buttonCssClass,'title'=>Yii::t('frontend','Submissions are closed for this contest'))); ?>

<?php endif; ?>